package com.example.demo.dao.daolmpl;

import com.example.demo.dao.UserInfoInterface;
import com.example.demo.entity.UserInfo;
import com.example.demo.entity.UserInfoMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

@Repository
public class UserInfoDao implements UserInfoInterface {

    @Resource
    UserInfoMapper userInfoMapper;

    @Override
    public UserInfo select(int id) {
        return userInfoMapper.selectByPrimaryKey(id);
    }

    @Override
    public int Update(String name, int id) {
        return userInfoMapper.updateName(name,id);
    }

    @Override
    public int UpdateMoney(int id, float money) {
        return userInfoMapper.updateMoney(id,money);
    }

    @Override
    public int insertUserInfo(UserInfo userInfo) {
        return userInfoMapper.insert(userInfo);
    }
}
